package com.cll.pmis.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.cll.pmis.common.validator.group.Insert;
import io.github.llchen.apidoc.annotation.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 药品入库
 * </p>
 *
 * @author chenliangliang
 * @since 2018-06-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(description = "入库表")
public class Input implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    //@JSONField(serialize = false)
    private Integer id;
    /**
     * 入库方式
     */
    @NotBlank(message = "入库方式不能为空",groups = {Insert.class})
    private String type;
    /**
     * 供应商
     */
    @NotBlank(message = "供应商不能为空",groups = {Insert.class})
    private String provider;
    /**
     * 操作人
     */
    private String username;
    /**
     * 状态，0->待审核，1->已审核
     */
    private Integer status;
    /**
     * 入库时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;


    @NotEmpty(message = "入库药品不能为空",groups = {Insert.class})
    @TableField(exist = false)
    private List<InputDrug> list;

    private String remark;

}
